let http = require("http");
let users = [
  { id: 55555, name: "zf1" },
  { id: 8888888, name: "zf2" },
  { id: 377, name: "zf3" },
  { id: 4, name: "zf4" },
];
let server = http.createServer(function (req, res) {
  res.setHeader("Access-Control-Allow-Origin", "*");
  if (req.url === "/api/users") {
    res.end(JSON.stringify(users));
  } else {
    res.end("not found");
  }
});
server.listen(3000, () => {
  console.log("http://localhost:3000");
});
